/**
 * @Filename: randomstring.h
 * @Description:
 * @Author: chengxiaojun
 * @Email: csforgood@gmail.com
 * @Time: 2011/11/11
 */
#ifndef __RANDOME_STRING_H__

#define  __RANDOME_STRING_H__

#include <string>
#include <stdio.h>
#include <vector>

using namespace std;

class NumberGenerator{
	public:
		int next();
                static NumberGenerator& instance();               
        private:
		NumberGenerator();
                NumberGenerator(const NumberGenerator&);
                NumberGenerator& operator=(NumberGenerator&);
                ~NumberGenerator();
	private:
		unsigned int m_seed;
                static NumberGenerator n;
};

class StringGenerator {

	public:
                static StringGenerator& instance();
		
                void generate_random_string(string &str, int min_length, int max_length, const char* dict);
		void generate_random_string(string &str, int min_length, int max_length);
	private:
                StringGenerator(const StringGenerator&);
		StringGenerator();
		
                ~StringGenerator();
                
                StringGenerator& operator=(StringGenerator&);
	private:	
                NumberGenerator *m_numgen;
                static StringGenerator s;
};
#endif
